import type { RouteRecordRaw, RouteRecordRedirectOption } from 'vue-router'

import type { IButtonMenuRoleMap } from '@/types/index.js'
// 路由元信息类型
export interface IMenuRouteMeta {
  title?: string
  icon?: string
  noCache?: boolean
  btns?: IButtonMenuRoleMap[]
  dicID?: string | null
  index?: number
  IsOpenWindow?: boolean
  affix?: boolean
  TargetFor?: string | null
  MenuCode?: string
  ParentCode?: string | null
  hidden?: boolean
  alwaysShow?: boolean
  isAuth?: boolean
}

export interface IMenuRouteNode extends Omit<RouteRecordRaw, 'meta' | 'children'> {
  meta: IMenuRouteMeta
  // name?:string
  children?: IMenuRouteNode[] | undefined
  redirect?: RouteRecordRedirectOption
  hidden?: boolean
}
